﻿using CodeLibrary.Consts;

namespace CodeLibrary.Extensions.Common
{
    public struct Age
    {
        public Age(int years, int months, int days)
        {
            Years = years;
            Months = months;
            Days = days;
        }
        public int Years;
        public int Months;
        public int Days;

        public override string ToString()
        {
            string formattedString = "";
            if (Years != 0)
            {
                formattedString += string.Format("{0} Years", Years);
            }

            if (Months != 0)
            {
                formattedString += string.Format("{0} Months", Months);
            }

            if (Days != 0)
            {
                formattedString += string.Format("{0} Days", Days);
            }

            return formattedString;
        }
    }
}
